package com.zhixi.controller.generator;

import com.zhixi.entity.Generator;
import com.zhixi.entity.R;
import com.zhixi.service.GeneratorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/10 14:36
 */
@RestController
@RequestMapping("/generator")
@Api(tags = "代码生成")
public class GeneratorController {

    @Autowired
    private GeneratorService generatorService;

    @ApiOperation("开始生成代码")
    @PostMapping("/start")
    public R generator(@RequestBody Generator generator) {
        generatorService.codeGenerator(generator);
        System.out.println("成功生成代码");
        return R.ok();
    }

}
